<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //Math.round() 四舍五入操作

    var result = Math.round(1.5);
    console.log(result);

    var num = 2.16;
    num = num *10;
    var result2 = Math.round(num);
    console.log(result2/10);

    //向下取整
     var result3 = Math.floor(1.6);
     var result4 = Math.ceil(1.3);//向上取整
     console.log(result3,result4);
</script>
</html>